<?php
require("db_config.php");

$con = mysql_connect($db_host,$db_user,$db_password);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db($db_name, $con);

$result = mysql_query("select timestamp,vi from audit where software_id=1 and action='TOKEN-IO:ACCESS' ");

$row=mysql_fetch_array($result);
$curtime=$_SERVER['REQUEST_TIME'];
echo $curtime."<br>";
echo $row['timestamp'];
if($curtime>($row['timestamp']+600)){
	mysql_query("delete from audit where software_id=1 and action='TOKEN-IO:ACCESS'");
}
mysql_close($con);
?>